int nCount = 0;                                                              
vector<string> output;
inline void ProcessOutPut(const vector<string> &output)                      
{                                                                            
	cout<<nCount++<<":"<<output[0]<<' '<<output[1]<<' '<<output[2]<<endl;
}                                                                            
                                                                             
void Permutation(const vector<vector<string> > &Data,int nDepth=0)           
{                                                                            
	if(nDepth == Data.size()-1)                                          
	{                                                                    
		for(int j=0;j<Data[nDepth].size();j++)                       
		{                                                            
			output[nDepth] = Data[nDepth][j];                    
			ProcessOutPut(output);                               
		}                                                            
		return;                                                      
	}                                                                    
	for(int i=0;i<Data[nDepth].size();i++)                               
	{                                                                    
		output[nDepth] = Data[nDepth][i];                            
		Permutation(Data,nDepth+1);                                  
	}                                                                    
}                                                                            
                                                                             
int main(int argc, char* argv[])                                             
{                                                                            
	vector<vector<string> > Data;                                        
	Data.resize(3);                                                      
	Data[0].push_back("I");                                              
	Data[0].push_back("me");                                             
	Data[0].push_back("my");                                             
	Data[0].push_back("myself");                                         
                                                                             
	Data[1].push_back("love");                                           
	Data[1].push_back("like");                                           
	Data[1].push_back("hate");                                          
	                                                                     
	Data[2].push_back("her");                                            
	Data[2].push_back("she");                                            
	output.resize(Data.size());
	Permutation(Data);                                                  
	 
	return 0;                                                            
}                                                                           